<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>封装</title>
</head>
<body>
    <div id="div1">div1</div>
    <div name="div2">div2</div>
</body>
<script src="my.js"></script>
<script>
    // jQuery就是基于js基础上封装的半成品
    // let div1 = document.getElementById("div1");
    // alert(div1);
    let div1 = getById("div1");
    alert(div1);

    let divs = getByName("div2");
    alert(divs.length);

    let divs2 = getByTag("div");
    alert(divs2.length);
</script>
</html>